package com.spa.domain.entity;

import com.spa.infrastructure.enums.dict.rule.RuleClassifyEnum;
import com.spa.infrastructure.enums.dict.rule.RuleFlagEnum;
import com.spa.infrastructure.enums.dict.rule.RuleTypeEnum;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class Shop {

    /** 门店id */
    private Long id;

    /** 门店logo */
    private String logo;

    /** 门店名称 */
    private String name;

    /** 门店负责人名称 */
    private String owner;

    /** 门店地址 */
    private String address;

    /** 门店所属城市id */
    private Long cityId;

    /** 门店所属城市 */
    private CitiesServed city;

    /** 门店负责人电话 */
    private String phone;

    /** 门店营业执照 */
    private String businessLicense;

    /** 门店备注信息 */
    private String remark;

    /** 门店入驻时间 */
    private Date createTime;

    /** 门店状态 */
    private Integer isDel;

    /** 提现周期（天） */
    private Integer withdrawPeriod;

    /** 规则列表 */
    private List<Rule> ruleList;

    private Integer flag;

    public static List<Rule> defaultRule(){
        List<Rule> ruleList = new ArrayList<>();

        //订单规则
        Rule orderRule = new Rule();
        orderRule.setType(RuleTypeEnum.$10.getCode());
        orderRule.setFlag(RuleFlagEnum.$10.getCode());
        orderRule.setClassify(RuleClassifyEnum.$20.getCode());
        orderRule.setVal("0.6");
        orderRule.setSerial(1);

        ruleList.add(orderRule);


        //加钟订单规则
        Rule orderExtRule = new Rule();
        orderExtRule.setType(RuleTypeEnum.$20.getCode());
        orderExtRule.setFlag(RuleFlagEnum.$20.getCode());
        orderExtRule.setClassify(RuleClassifyEnum.$20.getCode());
        orderExtRule.setVal("0.6");
        orderExtRule.setSerial(1);

        ruleList.add(orderExtRule);

        return ruleList;
    }

}
